package org.capi.capi20;

/**
 * Common ISDN Application Programming Interface (CAPI 2.0) for Java.
 */
public interface Capi {

    /**
     * Tells whether the CAPI is available.
     *
     * @return True, if the CAPI is available, otherwise false.
     * @throws CapiException XXX.
     */
    public boolean installed() throws CapiException;

    /**
     * @param messageBufferSize
     * @param maxLogicalConnections
     * @param maxBDataBlocks
     * @param maxBDataLen
     * @return
     * @throws CapiException
     */
    public short register(short messageBufferSize,
            short maxLogicalConnections,
            short maxBDataBlocks,
            short maxBDataLen) throws CapiException;

    /**
     * @param appId
     * @throws CapiException
     */
    public void release(short appId) throws CapiException;

    /**
     * @param appId
     * @param msg
     * @throws CapiException
     */
    public void putMessage(short appId, byte [] msg) throws CapiException;

    /**
     * @param appId
     * @return
     * @throws CapiException XXX.
     */
    public byte [] getMessage(short appId) throws CapiException;

    /**
     * Wait for a message.
     *
     * @param appId The application ID which has be been returned from
     *              register().
     * @throws CapiException XXX.
     */
    public void waitForSignal(short appId) throws CapiException;

    /**
     * @param controller
     * @return
     * @throws CapiException
     */
    public byte [] getProfile(int controller) throws CapiException;

    /**
     *
     * @param controller
     * @return
     * @throws CapiException
     */
    public short [] getVersion(int controller) throws CapiException;

    /**
     *
     * @param controller
     * @return
     * @throws CapiException
     */
    public String getManufacturer(int controller) throws CapiException;

    /**
     * @param controller
     * @return
     * @throws CapiException
     */
    public String getSerialNumber(int controller) throws CapiException;

}
